package databases

import (
	"time"
	"github.com/go-xorm/xorm"
	"permission/config"
	"permission/vigo_loger"
	"gitlab.gaodun.com/golib/gderror"
)

type Tpo_Sys_User_AliyunMq struct {
	Id          int64
	UserId      int64
	MqId        string
	MqUserId    string
	MqAccount   string
	MqPwd       string
	MqGroupId   string
	MqPhone     string
	MqExtension string
	CreateBy    int32
	UpdateBy    int32
	IsDeleted   int
	IsDefault   int
	CreateTime  time.Time
	UpdateTime  time.Time
}


type UserAliyunFactory struct {
	Table         Tpo_Sys_User_AliyunMq
	engine        *xorm.Engine
	RowsSlicePtr  []Tpo_Sys_User_AliyunMq
}


func NewUserAliMQ() *UserAliyunFactory {
	uf := new(UserAliyunFactory)
	uf.engine, _ = config.InitEng()
	return uf
}

func (uf *UserAliyunFactory) FindInfoByUserId(userId ...int64) error {
	err := uf.engine.In("UserId", userId).Find(&(uf.RowsSlicePtr))
	if err != nil {
		vigo_loger.AddGrayLog(gderror.New(err.Error()).Error())
	}
	return err
}





